Optimal. Leaf size=59 \[ \frac {(a c+b d) x}{c^2+d^2}-\frac {(b c-a d) \log (c \cos (e+f x)+d \sin (e+f x))}{\left (c^2+d^2\right ) f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 59, normalized size of antiderivative = 1.00, number of steps
used = 2, number of rules used = 2, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.087, Rules used = {3612, 3611}
\begin {gather*} \frac {x (a c+b d)}{c^2+d^2}-\frac {(b c-a d) \log (c \cos (e+f x)+d \sin (e+f x))}{f \left (c^2+d^2\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3611
Rule 3612
Rubi steps
\begin {align*} \int \frac {a+b \tan (e+f x)}{c+d \tan (e+f x)} \, dx &=\frac {(a c+b d) x}{c^2+d^2}-\frac {(b c-a d) \int \frac {d-c \tan (e+f x)}{c+d \tan (e+f x)} \, dx}{c^2+d^2}\\ &=\frac {(a c+b d) x}{c^2+d^2}-\frac {(b c-a d) \log (c \cos (e+f x)+d \sin (e+f x))}{\left (c^2+d^2\right ) f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.12, size = 65, normalized size = 1.10 \begin {gather*} \frac {2 (a c+b d) \text {ArcTan}(\tan (e+f x))+(b c-a d) \left (\log \left (\sec ^2(e+f x)\right )-2 \log (c+d \tan (e+f x))\right )}{2 \left (c^2+d^2\right ) f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.18, size = 82, normalized size = 1.39
method | result | size |
derivativedivides | \(\frac {\frac {\frac {\left (-a d +b c \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (a c +b d \right ) \arctan \left (\tan \left (f x +e \right )\right )}{c^{2}+d^{2}}+\frac {\left (a d -b c \right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{c^{2}+d^{2}}}{f}\) | \(82\) |
default | \(\frac {\frac {\frac {\left (-a d +b c \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (a c +b d \right ) \arctan \left (\tan \left (f x +e \right )\right )}{c^{2}+d^{2}}+\frac {\left (a d -b c \right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{c^{2}+d^{2}}}{f}\) | \(82\) |
norman | \(\frac {\left (a c +b d \right ) x}{c^{2}+d^{2}}+\frac {\left (a d -b c \right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{f \left (c^{2}+d^{2}\right )}-\frac {\left (a d -b c \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 f \left (c^{2}+d^{2}\right )}\) | \(85\) |
risch | \(\frac {i x b}{i d -c}-\frac {a x}{i d -c}-\frac {2 i a d x}{c^{2}+d^{2}}+\frac {2 i b c x}{c^{2}+d^{2}}-\frac {2 i a d e}{f \left (c^{2}+d^{2}\right )}+\frac {2 i b c e}{f \left (c^{2}+d^{2}\right )}+\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i d +c}{i d -c}\right ) a d}{f \left (c^{2}+d^{2}\right )}-\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i d +c}{i d -c}\right ) b c}{f \left (c^{2}+d^{2}\right )}\) | \(186\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.56, size = 91, normalized size = 1.54 \begin {gather*} \frac {\frac {2 \, {\left (a c + b d\right )} {\left (f x + e\right )}}{c^{2} + d^{2}} - \frac {2 \, {\left (b c - a d\right )} \log \left (d \tan \left (f x + e\right ) + c\right )}{c^{2} + d^{2}} + \frac {{\left (b c - a d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{2} + d^{2}}}{2 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 1.24, size = 79, normalized size = 1.34 \begin {gather*} \frac {2 \, {\left (a c + b d\right )} f x - {\left (b c - a d\right )} \log \left (\frac {d^{2} \tan \left (f x + e\right )^{2} + 2 \, c d \tan \left (f x + e\right ) + c^{2}}{\tan \left (f x + e\right )^{2} + 1}\right )}{2 \, {\left (c^{2} + d^{2}\right )} f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [C] Result contains complex when optimal does not.
time = 0.47, size = 524, normalized size = 8.88 \begin {gather*} \begin {cases} \frac {\tilde {\infty } x \left (a + b \tan {\left (e \right )}\right )}{\tan {\left (e \right )}} & \text {for}\: c = 0 \wedge d = 0 \wedge f = 0 \\\frac {i a f x \tan {\left (e + f x \right )}}{2 d f \tan {\left (e + f x \right )} - 2 i d f} + \frac {a f x}{2 d f \tan {\left (e + f x \right )} - 2 i d f} + \frac {i a}{2 d f \tan {\left (e + f x \right )} - 2 i d f} + \frac {b f x \tan {\left (e + f x \right )}}{2 d f \tan {\left (e + f x \right )} - 2 i d f} - \frac {i b f x}{2 d f \tan {\left (e + f x \right )} - 2 i d f} - \frac {b}{2 d f \tan {\left (e + f x \right )} - 2 i d f} & \text {for}\: c = - i d \\- \frac {i a f x \tan {\left (e + f x \right )}}{2 d f \tan {\left (e + f x \right )} + 2 i d f} + \frac {a f x}{2 d f \tan {\left (e + f x \right )} + 2 i d f} - \frac {i a}{2 d f \tan {\left (e + f x \right )} + 2 i d f} + \frac {b f x \tan {\left (e + f x \right )}}{2 d f \tan {\left (e + f x \right )} + 2 i d f} + \frac {i b f x}{2 d f \tan {\left (e + f x \right )} + 2 i d f} - \frac {b}{2 d f \tan {\left (e + f x \right )} + 2 i d f} & \text {for}\: c = i d \\\frac {x \left (a + b \tan {\left (e \right )}\right )}{c + d \tan {\left (e \right )}} & \text {for}\: f = 0 \\\frac {a x + \frac {b \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f}}{c} & \text {for}\: d = 0 \\\frac {2 a c f x}{2 c^{2} f + 2 d^{2} f} + \frac {2 a d \log {\left (\frac {c}{d} + \tan {\left (e + f x \right )} \right )}}{2 c^{2} f + 2 d^{2} f} - \frac {a d \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 c^{2} f + 2 d^{2} f} - \frac {2 b c \log {\left (\frac {c}{d} + \tan {\left (e + f x \right )} \right )}}{2 c^{2} f + 2 d^{2} f} + \frac {b c \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 c^{2} f + 2 d^{2} f} + \frac {2 b d f x}{2 c^{2} f + 2 d^{2} f} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.47, size = 97, normalized size = 1.64 \begin {gather*} \frac {\frac {2 \, {\left (a c + b d\right )} {\left (f x + e\right )}}{c^{2} + d^{2}} + \frac {{\left (b c - a d\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{2} + d^{2}} - \frac {2 \, {\left (b c d - a d^{2}\right )} \log \left ({\left | d \tan \left (f x + e\right ) + c \right |}\right )}{c^{2} d + d^{3}}}{2 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 5.49, size = 93, normalized size = 1.58 \begin {gather*} \frac {\ln \left (c+d\,\mathrm {tan}\left (e+f\,x\right )\right )\,\left (a\,d-b\,c\right )}{f\,\left (c^2+d^2\right )}-\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )\,\left (-b+a\,1{}\mathrm {i}\right )}{2\,f\,\left (c+d\,1{}\mathrm {i}\right )}-\frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )+1{}\mathrm {i}\right )\,\left (a-b\,1{}\mathrm {i}\right )}{2\,f\,\left (d+c\,1{}\mathrm {i}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________